<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="ApplyKindMaintain.aspx.vb" Inherits="WebForm_SysParam_ApplyKindMaintain" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
         <ContentTemplate>
             <asp:HiddenField ID="hiUID" runat="server" />
            <asp:HiddenField ID="hiKind" runat="server" />
            <asp:Label ID="lblsuit_site" runat="server" meta:resourcekey="lblsuit_site"></asp:Label>
            <asp:DropDownList ID="ddlsuit_site" runat="server" AutoPostBack="True" 
                DataSourceID="objDSsite" DataTextField="site_name" DataValueField="site_code">
            </asp:DropDownList>
            <asp:Button ID="btnInsert" runat="server" meta:resourcekey="btnInsert" />
            <br />
                 <asp:ObjectDataSource ID="objDSsite" runat="server" SelectMethod="GetAllSite" 
                TypeName="Telecom.BBL.SiteBBL">
                <SelectParameters>
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="objDSApplyKind" runat="server" 
                SelectMethod="GetApplyKind" TypeName="Telecom.BBL.ApplyKindBBL"  UpdateMethod="UpdateApplyKind">
                    <UpdateParameters>
                    <asp:Parameter Name="canModi" Type="Boolean" />
                    <asp:Parameter Name="kind_code" Type="String" />
                    <asp:Parameter Name="kind_name" Type="String" />
                    <asp:ControlParameter ControlID="ddlsuit_site" Name="suit_site" 
                        PropertyName="SelectedValue" Type="String" />
                    <asp:Parameter Name="kind_desc" Type="String" />
                    <asp:Parameter Name="NeedApprove" Type="String" />
                    <asp:Parameter Name="WarnMessage" Type="String" />
                    <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" 
                        Type="String" />
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                        <asp:Parameter Name="CellPhoneType" />
                        <asp:Parameter Name="PhoneNoType" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:ControlParameter ControlID="ddlsuit_site" Name="suit_site" 
                        PropertyName="SelectedValue" Type="String" />
                    <asp:ControlParameter ControlID="hiKind" ConvertEmptyStringToNull="False" 
                        Name="Kind" PropertyName="Value" Type="String" />
                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                        Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:HiddenField ID="hiDBName" runat="server" />
            <table>
                <tr>
                    <td>
                         <TServerControl:TGridView ID="gvKindType" runat="server" AllowHoverEffect="True" 
                          AllowHoverSelect="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="objDSApplyKind" 
                          ShowFooterWhenEmpty="False" ShowHeaderWhenEmpty="True" SkinID="pager" 
                          TotalRowCount="0">
                          <Columns>
                                <asp:TemplateField>
                                    <EditItemTemplate>
                                        <asp:Button ID="btnUpdate" runat="server" CommandName="Update" 
                                        meta:resourcekey="btnUpdate" />
                                        <asp:Button ID="btnCancel" runat="server" CommandName="Cancel" 
                                        meta:resourcekey="btnCancel" />
                                     </EditItemTemplate>
                                     <ItemTemplate>
                                        <asp:Button ID="btnEdit" runat="server" CommandName="Edit" 
                                        meta:resourcekey="btnEdit" Text="Button" />
                                     </ItemTemplate>
                                 </asp:TemplateField>
                                 <asp:TemplateField meta:resourcekey="kind_code">
                                     <EditItemTemplate>
                                         <asp:TextBox ID="txtkind_code" runat="server" Enabled='<%# Bind("canModi") %>' Text='<%# Bind("kind_code") %>'
                                         Width="68px"></asp:TextBox>           
                                     </EditItemTemplate>
                                     <ItemTemplate>
                                         <asp:Label ID="lblkind_code" runat="server" Text='<%# Bind("kind_code") %>' Width="68px"></asp:Label>
                                     </ItemTemplate>
                                 </asp:TemplateField>
                                 <asp:TemplateField meta:resourcekey="kind_name">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtkind_name" runat="server" Text='<%# Bind("kind_name") %>'
                                        Width="68px"></asp:TextBox>         
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblkind_name" runat="server" Text='<%# Bind("kind_name") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="kind_desc">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtkind_desc" runat="server" Text='<%# Bind("kind_desc") %>'
                                        Width="68px"></asp:TextBox>   
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblkind_desc" runat="server" Text='<%# Bind("kind_desc") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="NeedApprove">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtNeedApprove" runat="server" Text='<%# Bind("NeedApprove") %>'
                                        Width="68px"></asp:TextBox>   
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblNeedApprove" runat="server" Text='<%# Bind("NeedApprove") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField meta:resourcekey="WarnMessage">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtWarnMessage" runat="server" Text='<%# Bind("WarnMessage") %>'
                                        Width="68px"></asp:TextBox>   
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblWarnMessage" runat="server" Text='<%# Bind("WarnMessage") %>' Width="68px"></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                 <asp:TemplateField meta:resourcekey="PhoneNoType">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlPhoneNoType" runat="server" Width="150px"       SelectedValue='<%# Bind("PhoneNoType") %>' >
                                        <asp:ListItem meta:resourcekey="PhoneNoType1"></asp:ListItem>
                                        <asp:ListItem meta:resourcekey="PhoneNoType2"></asp:ListItem>
                                       
                                    </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                      <asp:DropDownList ID="ddlPhoneNoType" runat="server" Width="150px" Enabled ="False" 
                                            SelectedValue='<%# Bind("PhoneNoType") %>'   >
                                              <asp:ListItem meta:resourcekey="PhoneNoType1"></asp:ListItem>
                                        <asp:ListItem meta:resourcekey="PhoneNoType2"></asp:ListItem>
                                       
                                    </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                 <asp:TemplateField meta:resourcekey="CellPhoneType">
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlCellPhoneType" runat="server" Width="120px"       SelectedValue='<%# Bind("CellPhoneType") %>' >
                                        <asp:ListItem meta:resourcekey="CellPhoneType1"></asp:ListItem>
                                        <asp:ListItem meta:resourcekey="CellPhoneType2"></asp:ListItem>
                                       
                                    </asp:DropDownList>
                                    </EditItemTemplate>
                                    <ItemTemplate >
                                      <asp:DropDownList ID="ddlCellPhoneType" runat="server" Width="120px" Enabled ="False" 
                                            SelectedValue='<%# Bind("CellPhoneType") %>'   >
                                        <asp:ListItem meta:resourcekey="CellPhoneType1"></asp:ListItem>
                                        <asp:ListItem meta:resourcekey="CellPhoneType2"></asp:ListItem>
                                       
                                    </asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                <asp:TemplateField meta:resourcekey="CrtUID">
                                     <ItemTemplate>
                                        <asp:Label ID="lblCrtUID" runat="server" Text='<%# Eval("CrtName") %>' Width="68px"></asp:Label>
                                     </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="CrtDate">
                                     <ItemTemplate>
                                        <asp:Label ID="lblCrtDate" runat="server" Text='<%# Eval("CrtDate","{0:d}") %>' Width="68px"></asp:Label>
                                     </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="ModiUID">
                                     <ItemTemplate>
                                        <asp:Label ID="lblModiUID" runat="server" Text='<%# Eval("ModiName") %>' Width="68px"></asp:Label>
                                     </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="ModiDate">
                                     <ItemTemplate>
                                        <asp:Label ID="lblModiDate" runat="server" Text='<%# Eval("ModiDate","{0:d}") %>' Width="68px"></asp:Label>
                                     </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField meta:resourcekey="Select">
                                        <EditItemTemplate>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Button ID="btnSelect"  CommandName ="Select" runat="server" meta:resourcekey="btnSelect"  CommandArgument='<%# Bind("kind_code") %>' />
                                        </ItemTemplate>
                                 </asp:TemplateField>
                        </Columns>
                      </TServerControl:TGridView>
                    </td>                    
                    </tr> 
            </table>
           
         </ContentTemplate>
   </asp:UpdatePanel>
   <asp:UpdatePanel ID="up" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server" BackColor="white" BorderWidth="1" Style="cursor: move;" Width="600px">

               <table>
                    <tr>
                        <td>   
                             <asp:HiddenField ID="hiKindDetail" runat="server" />
                             <asp:HiddenField ID="hikind_code" runat="server" />
                            <asp:Button ID="btnInsertNew" runat="server" meta:resourcekey="btnInsertNew" visible="false" />                 
                               <TServerControl:TGridView ID="gv" runat="server"  visible="false" AllowHoverEffect="True" 
                            AllowHoverSelect="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="objDSModifyKind" 
                            ShowFooterWhenEmpty="False" ShowHeaderWhenEmpty="True" SkinID="pager" 
                            TotalRowCount="0">
                            <Columns>
                                <asp:TemplateField>
                                     <EditItemTemplate>
                                            <asp:Button ID="btniUpdate" runat="server" CommandName="Update" 
                                            meta:resourcekey="btniUpdate" />
                                            <asp:Button ID="btniCancel" runat="server" CommandName="Cancel" 
                                            meta:resourcekey="btniCancel" />
                                      </EditItemTemplate>
                                      <ItemTemplate>
                                            <asp:Button ID="btnDelete"  runat="server" meta:resourcekey="btnDelete" CommandName="Delete" CommandArgument='<%# Bind("kind_code") %>' />
                                      </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField  meta:resourcekey="gvkind_code">
                                      <EditItemTemplate>
                                           <asp:Label ID="lbliekind_code" runat="server"  Text='<%# Bind("kind_code") %>' Width="68px"></asp:Label>
                                      </EditItemTemplate>
                                      <ItemTemplate>
                                            <asp:Label ID="lblikind_code" runat="server"  Text='<%# Bind("kind_code") %>' Width="68px"></asp:Label>
                                      </ItemTemplate>
                                </asp:TemplateField>
                               <asp:TemplateField meta:resourcekey="gvtype_code">
                                       <EditItemTemplate>
                                           <asp:DropDownList ID="ddlitype_code" runat="server" 
                                            DataSourceID="objDStype" DataTextField="type_name" DataValueField="type_code" SelectedValue='<%# Bind("type_code") %>'>
                                            </asp:DropDownList>
                                       </EditItemTemplate>
                                       <ItemTemplate>
                                            <asp:Label ID="lblitype_name" runat="server"  Text='<%# Bind("type_name") %>' Width="68px"></asp:Label>
                                            <asp:Label ID="lblitype_code" runat="server"  Text='<%# Bind("type_code") %>' Width="68px" visible=false></asp:Label>
                                       </ItemTemplate>
                               </asp:TemplateField>    
                               <asp:TemplateField meta:resourcekey="gvCrtUID">
                                       <ItemTemplate>
                                            <asp:Label ID="lbliCrtUID" runat="server"  Text='<%# Eval("CrtName") %>' Width="68px"></asp:Label>
                                       </ItemTemplate>
                               </asp:TemplateField>    
                               <asp:TemplateField meta:resourcekey="gvCrtDate">
                                       <ItemTemplate>
                                            <asp:Label ID="lbliCrtDate" runat="server"  Text='<%# Eval("CrtDate","{0:d}") %>' Width="68px"></asp:Label>
                                       </ItemTemplate>
                               </asp:TemplateField>     
                         <%--      <asp:TemplateField meta:resourcekey="gvModiUID">
                                        <ItemTemplate>
                                            <asp:Label ID="lbliModiUID" runat="server"  Text='<%# Eval("ModiName") %>' Width="68px"></asp:Label>
                                       </ItemTemplate>
                               </asp:TemplateField>
                               <asp:TemplateField meta:resourcekey="gvModiDate">
                                       <ItemTemplate>
                                            <asp:Label ID="lbliModiDate" runat="server"  Text='<%# Eval("ModiDate","{0:d}") %>' Width="68px"></asp:Label>
                                       </ItemTemplate>
                               </asp:TemplateField>   --%>                  
                            </Columns>
                            </TServerControl:TGridView>
                            <asp:ObjectDataSource ID="objDSModifyKind" runat="server" TypeName="Telecom.BBL.ApplyKindBBL" SelectMethod="GetModifyKind" UpdateMethod="InsertModifyKind" DeleteMethod="DeleteModifykind">
                               <DeleteParameters>
                                   <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                                   <asp:ControlParameter ControlID="ddlsuit_site" Name="suit_site" 
                                    PropertyName="SelectedValue" Type="String" />
                                            <asp:ControlParameter ControlID="hikind_code" Name="kind_code" PropertyName="Value"
                                                Type="String" />
                                     <asp:Parameter Name="type_code" Type="String" />
                               </DeleteParameters>           
                               <UpdateParameters>
                                    <asp:ControlParameter ControlID="hikind_code" Name="kind_code" PropertyName="Value"
                                                Type="String" />
                                    <asp:ControlParameter ControlID="ddlsuit_site" Name="suit_site" 
                                    PropertyName="SelectedValue" Type="String" />
                                    <asp:Parameter Name="type_code" Type="String" />
                                    <asp:ControlParameter ControlID="hiUID" Name="UID" PropertyName="Value" 
                                    Type="String" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                                </UpdateParameters>
                                <SelectParameters>
                                      <asp:ControlParameter ControlID="hikind_code" Name="kind_code" PropertyName="Value"
                                                Type="String" />
                                      <asp:ControlParameter ControlID="ddlsuit_site" Name="suit_site" 
                                    PropertyName="SelectedValue" Type="String" />
                                    <asp:ControlParameter ControlID="hiKindDetail" ConvertEmptyStringToNull="False" 
                                    Name="Kind" PropertyName="Value" Type="String" />
                                    <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" 
                                    Type="String" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:ObjectDataSource ID="objDStype" runat="server" TypeName="Telecom.BBL.ApplyKindBBL" SelectMethod="GetTypeCode">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="ddlsuit_site" Name="suit_site" 
                                    PropertyName="SelectedValue" Type="String" 
                                    ConvertEmptyStringToNull="False" />
                                <asp:ControlParameter ControlID="hiDBName" Name="dbName" PropertyName="Value" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                         </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:Button ID="btnCancel" runat="server" Text="<%$ Resources:Cancel%>" />
                        </td>
                    </tr>
                    
               </table>
            </asp:Panel>
            <asp:Button ID="btnDummy" runat="server" Style="display: none" SkinID="null" />
            <ajaxToolkit:ModalPopupExtender ID="mpSearch" runat="server" TargetControlID="btnDummy"  X="30"
            PopupControlID="panel1" CancelControlID="btnCancel" PopupDragHandleControlID="panel1" />

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

